package org.summer.lawyer.constant.enums;

import cn.hutool.core.util.ArrayUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 派单状态
 */
@Getter
@AllArgsConstructor
public enum DispatchOrderStatus {

    /**
     * Pending 待处理
     */
    PENDING("Pending", "待处理"),

    /**
     * Processing 已分派,还没接单
     */
    PROCESSING("Processing", "待接单"),

    /**
     * Confirmed  已接单
     */
    CONFIRMED("Confirmed", "处理中"),

    /**
     * Completed 申请完成
     */
    COMPLETED("Completed", "申请完成"),

    /**
     * 已完成
     */
    FINISHED("Finished", "已完成"),

    /**
     * Returned 撤回
     */
    RETURNED("Returned", "已退回");

    public static DispatchOrderStatus getByCode(String code) {
        return ArrayUtil.firstMatch(item -> item.getCode().equals(code), values());
    }

    private final String code;

    private final String info;

}
